首页>代码>android开发一种类似于win8的磁铁效果>/按钮点击WIN8 磁贴效果/src/com/ljp/ani/Record.java
package com.ljp.ani;

public class Record{
	

	public int getDegrees(float a, float b) {
		float dx = a;
		float x = b / 4;
		float x2 = 3 * b / 4;
		if (dx < x / 10)
			return 10;
		else if (dx < x / 5)
			return 9;
		else if (dx < x * 3 / 10)
			return 8;
		else if (dx < x * 2 / 5)
			return 7;
		else if (dx < x * 5 / 10)
			return 6;
		else if (dx < x * 3 / 5)
			return 5;
		else if (dx < x * 7 / 10)
			return 4;
		else if (dx < x * 4 / 5)
			return 3;
		else if (dx < x * 9 / 10)
			return 2;
		else if (dx < x)
			return 2;
		else if (dx - x2 > x * 9 / 10)
			return 10;
		else if (dx - x2 > x * 4 / 5)
			return 9;
		else if (dx - x2 > x * 7 / 10)
			return 8;
		else if (dx - x2 > x * 3 / 5)
			return 7;
		else if (dx - x2 > x * 5 / 10)
			return 6;
		else if (dx - x2 > x * 2 / 5)
			return 5;
		else if (dx - x2 > x * 3 / 10)
			return 4;
		else if (dx - x2 > x / 5)
			return 3;
		else if (dx - x2 > x / 10)
			return 2;
		return 10;
	}
}
最近下载更多
zhouoys  LV1 2019年5月18日
lkduhuan  LV19 2018年11月27日
Xiaoqiang123  LV6 2016年9月7日
wsliwei  LV2 2016年7月29日
a578195315  LV1 2016年6月21日
kfzxh1  LV2 2015年11月12日
sdxiyuan  LV1 2015年10月16日
wcndy  LV2 2015年8月22日
zyk888  LV2 2015年8月9日
huyang1990  LV1 2015年1月15日
最近浏览更多
芽哇哇棉花堂  LV2 2023年5月19日
dglin20001030  LV1 2023年5月18日
wengzheng007  LV1 2022年11月22日
eddie2260  LV2 2022年5月24日
bingpine  LV6 2022年5月9日
tomfish000  LV2 2021年5月31日
xliulang  LV18 2021年1月18日
a566566  LV9 2020年12月29日
baizhongcai  LV24 2020年12月25日
natism  LV9 2020年12月3日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友